<template>
  <div>
    <Table :headerData="headerData" :tableData="tableData" @btnText="btnText"></Table>
  </div>
</template>

<script>
import Table from "@/components/Table.vue";
export default {
  methods: {
    btnText(e) {
      let arr = {
        name: `TabChilder-${e.id}`,
        component: "TabChilder",
        label: `我是详情页-${e.name}`,
        params: {
          name: "男，2018级，软件工程学院"
        }
      };
      this.$common.judgeTab(arr, "TabChilder");
    }
  },
  components: {
    Table
  },
  data() {
    const item = [
      {
        id: "1",
        name: "张三",
        age: "18"
      },
      {
        id: "2",
        name: "李四",
        age: "20"
      }
    ];
    return {
      headerData: [
        {
          label: "姓名",
          value: "name",
          type: "btnText"
        },
        {
          label: "年龄",
          value: "age"
        }
      ],
      tableData: item
    };
  }
};
</script>

<style>
</style>